﻿// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.RpcResponse
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 8E14765A-6610-409A-BA36-099A0642905D
// Assembly location: E:\git\ALLIDA\windll\infocard.exe

using System;
using System.Runtime.InteropServices;

namespace Microsoft.InfoCards
{
  internal struct RpcResponse
  {
    public int Length;
    public IntPtr Data;

    public IntPtr Marshal()
    {
      return RpcResponse.Create(this.Data, this.Length);
    }

    public static IntPtr Create(IntPtr data, int length)
    {
      RpcResponse rpcResponse = new RpcResponse();
      IntPtr num = Marshal.AllocHGlobal(Marshal.SizeOf(typeof (RpcResponse)));
      try
      {
        rpcResponse.Length = length;
        rpcResponse.Data = data;
        Marshal.StructureToPtr((object) rpcResponse, num, false);
        return num;
      }
      catch
      {
        Marshal.FreeHGlobal(num);
        throw;
      }
    }
  }
}
